
[Collection : ClnSaleInfo]
    Type     : Vouchers : Stock Item
    Child Of : $$BaseOwner:#VchStockItem
    Filter   : SalesFilt 
    Fetch	: LedgerEntries.PartyLedgerName, LedgerEntries.LedgerName


[System : Formula]
    MStk      : $StockItemName = $$BaseOwner:#VCHStockItem
    SalesFilt : $$IsSales:$VoucherTypeName



[#Field : VCH StockItem]
    Key : mKeyF4
Tooltip : "Press F4 to See Item History"
    
 
[Key : mKeyF4]
    Key : F4
    Action : Display : RptViewHistory

[Report : RptViewHistory]
    Form : FrmViewHistory
      
[Form : FrmViewHistory]
	Part : PrtViewHistory
	Height : 50 % Screen
	Vertical Alignment : Bottom

[Part : PrtViewHistory]
	Line   : LnViewHistoryTitle, LnViewHistoryHD, LnViewHistoryData
	Repeat : LnViewHistoryData : ClnSaleInfo
	Scroll : Vertical

[Line : LnViewHistoryTitle]
	Field : FldVwStkItem
	Fixed : Yes

[Field : FldVwStkItem]
	Use        : Short Name Field
	Set As     : "Sales History For : " + #VCHStockItem
	Full Width : Yes
	Align      : Centre           


[Line : LnViewHistoryHD]
	Use : LnViewHistoryData
	Local : Field : Default : Type : String
	Local : Field : Default : Align : Centre
	Local : Field : FldViewHistory0 : Set As : "Voucher Type"
	Local : Field : FldViewHistory1 : Set As : "Invoice No"
	Local : Field : FldViewHistoryDt: Set As : "Date"
	Local : Field : FldViewHistory2 : Set As : "Party Name"
	Local : Field : FldViewHistory3 : Set As : "Qty"
	Local : Field : FldViewHistory4 : Set As : "Rate"
	Local : Field : FldViewHistory5 : Set As : "Discount"
	Local : Field : FldViewHistory6 : Set As : "Amount(Rs.)"
	Border : Column Titles
	Fixed : Yes


[Line : LnViewHistoryData]
	Field :  FldViewHistory1, FldViewHistoryDt, FldViewHistory2 ;;FldViewHistory0,
	Right Field : FldViewHistory3, FldViewHistory4, FldViewHistory5, FldViewHistory6
	Local : Field : FldViewHistory0 : Set As : $VoucherTypeName
	Local : Field : FldViewHistory1 : Set As : $VoucherNumber
	Local : Field : FldViewHistoryDt: Set As : $Date
	Local : Field : FldViewHistory2 : Set As : $PartyLedgerName
	Local : Field : FldViewHistory3 : Set As : $$FilterValue:$BilledQty:InventoryEntries:1:mStk
	Local : Field : FldViewHistory4 : Set As : $$FilterValue:$Rate:InventoryEntries:1:mStk
	Local : Field : FldViewHistory5 : Set As : $$FilterValue:$discount:InventoryEntries:1:mStk
	Local : Field : FldViewHistory6 : Set As : $$FilterValue:$Amount:InventoryEntries:1:mStk
;;  Empty If : NOT $$IsSalesOrder:$VoucherTypeName
	Explode : PrtViewHistoryData : $$FilterCount:InventoryEntries:mStk -1 > 0

[Part : PrtViewHistoryData]
	Line : LnViewHistoryData1
	Repeat : LnViewHistoryData1 : InventoryEntries

[Line : LnViewHistoryData1]
	Field : FldViewHistory0, FldViewHistory1, FldViewHistoryDt, FldViewHistory2 
	Right Field : FldViewHistory3, FldViewHistory4, FldViewHistory5, FldViewHistory6
	Local : Field : FldViewHistory0 : Set As : $$Owner:$VoucherTypeName
	Local : Field : FldViewHistory1 : Set As : $$Owner:$VoucherNumber
	Local : Field : FldViewHistoryDt: Set As : $$Owner:$Date
	Local : Field : FldViewHistory2 : Set As : $$Owner:$PartyLedgerName
	Local : Field : FldViewHistory3 : Set As : $BilledQty
	Local : Field : FldViewHistory4 : Set As : $Rate
	Local : Field : FldViewHistory5 : Set As : $Discount
	Local : Field : FldViewHistory6 : Set As : $Amount
	Empty if : NOT @@mStk  OR $$ItemSerial=0

    

[Field : FldViewHistory0]
    Use : Short Name Field    

[Field : FldViewHistory1]
    Use : Short Name Field    

[Field : FldViewHistoryDt]
    Use : Short Date Field    

[Field : FldViewHistory2]
    Use : Name Field

[Field : FldViewHistory3]
    Use : Qty Field

[Field : FldViewHistory4]
    Use : Rate Field

[Field : FldViewHistory5]
    Use : Number Field
    Align : Right
    Format : "Percentage"

[Field : FldViewHistory6]
    Use : Amount Field


;; Eof




